﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Rose.Models;

namespace Rose.Models
{
    public partial  class UserInfo
    {
        private Database_RoseEntities db = new Database_RoseEntities();
        public string Address 
        {
            
            get 
            {
                string location = string.Empty;

                if (!string.IsNullOrEmpty(AddressProvince))
                    location += (AddressProvince + " ");
                if (!string.IsNullOrEmpty(AddressCity))
                    location += (AddressCity + " ");
                if (!string.IsNullOrEmpty(AddressTown))
                    location += (AddressTown+" ");
                if (!string.IsNullOrEmpty(AddressStreet))
                    location += (AddressStreet);
                return location;
            }
        }

        public string SchoolInformation
        {
            get
            {
                string location = string.Empty;
                if (!string.IsNullOrEmpty(University))
                    location += (University + " ");
                if (!string.IsNullOrEmpty(College))
                    location += (College);
                return location;
            }
            
        }

        public string SchoolDetailInformation
        {
            get
            {
                string location = string.Empty;
                if (!string.IsNullOrEmpty(University))
                    location += (University + " ");
                if (!string.IsNullOrEmpty(College))
                    location += (College + " ");
                if (!string.IsNullOrEmpty(Major))
                    location += Major;
                return location;
            }
        }


        public string CollegeYear
        {
            get
            {
                string location = string.Empty;
                if (!string.IsNullOrEmpty(College))
                    location += College;
                if (!string.IsNullOrEmpty(College))
                    location +=(SchoolYear.ToString().Substring(2,2)+"级");
                if (!string.IsNullOrEmpty(location))
                return location;
                return SchoolInformation;

            }
        }

        public string CollegeMajorClass
        {
            get
            {
                string location = string.Empty;
                if (!string.IsNullOrEmpty(College))
                    location += (College+" ");
                if (!string.IsNullOrEmpty(Major))
                    location += Major;
                if(!string.IsNullOrEmpty(location))
                    return location;
                return SchoolInformation;
            }
        }

        //public string MajorClass
        //{
        //    get
        //    {
        //        string location = string.Empty;
        //        if (!string.IsNullOrEmpty(College))
        //            location += College;
        //        if (!string.IsNullOrEmpty(Major))
        //            location += Major;
        //        if (!string.IsNullOrEmpty(ClassRoom))
        //            location += ClassRoom;
              
        //        return location;
        //    }
        //}

        

        public string BirthDay
        {
            get 
            {
                if (BirthDate != null)
                {
                    int year = BirthDate.Value.Year;
                    int month = BirthDate.Value.Month;
                    int day = BirthDate.Value.Day;
                    return year.ToString() + "-" + month.ToString() + "-" + day.ToString();
                }
                else return string.Empty;
            }
        }

        public string Gender
        {
            get
            {
                return IsMan == true ? "男" : "女";
            }
        }

       

    }
}